using System;
using System.Windows;
using System.Windows.Media.Animation;
namespace Microsoft.Expression.Interactivity.Media
{
	public class StoryboardCompletedTrigger : StoryboardTrigger
	{
		protected override void OnDetaching()
		{
			base.OnDetaching();
			if (base.Storyboard != null)
			{
				base.Storyboard.remove_Completed(new EventHandler(this.Storyboard_Completed));
			}
		}
		protected override void OnStoryboardChanged(DependencyPropertyChangedEventArgs args)
		{
			Storyboard storyboard = args.get_OldValue() as Storyboard;
			Storyboard storyboard2 = args.get_NewValue() as Storyboard;
			if (storyboard != storyboard2)
			{
				if (storyboard != null)
				{
					storyboard.remove_Completed(new EventHandler(this.Storyboard_Completed));
				}
				if (storyboard2 != null)
				{
					storyboard2.add_Completed(new EventHandler(this.Storyboard_Completed));
				}
			}
		}
		private void Storyboard_Completed(object sender, EventArgs e)
		{
			base.InvokeActions(e);
		}
	}
}
